package puppy.servlet.helpers;

import java.net.HttpURLConnection;
import java.net.URL;

public class UserInitialization {

	/**
	 * @param args
	 */
	
	
	
	  public static boolean urlExists(String URLName){
		    try {
		      HttpURLConnection.setFollowRedirects(false);
		      // note : you may also need
		      //        HttpURLConnection.setInstanceFollowRedirects(false)
		      HttpURLConnection con =
		         (HttpURLConnection) new URL(URLName).openConnection();
		      con.setRequestMethod("HEAD");
		      return (con.getResponseCode() == HttpURLConnection.HTTP_OK);
		    }
		    catch (Exception e) {
		       e.printStackTrace();
		       return false;
		    }
		  }

	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
